package bdz.projects.atwww.electrolux.views.analogue.support
{
	import bdz.projects.atwww.electrolux.ui.ELOptionItem;
	
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.events.Event;
	import flash.events.MouseEvent;

	public class ELAnalogueOptionItem extends ELOptionItem {
		private var clicker:SimpleButton;
		public function ELAnalogueOptionItem() {
			super(getAbstract());
		}
		private function onClickerClick(evt:MouseEvent):void{
			stepDown();
		}
		override protected function initializeComponent(evt:Event):void{
			clicker = this["optionClicker"];
			clicker.addEventListener(MouseEvent.CLICK, onClickerClick);
			var sels:Array = _optionRef.selections;
			var sy:Number = 0;
			
			for each(var o:Object in sels){
				var ref:MovieClip = new AnalogueOptionSelection();
				ref.info = o;
				ref.x = -4;
				if(o.selected){
					_currentStep = o.index;
					_lastSelected = ref;
				}
				ref.y = sy;
				sy+=18;
				_selections.push(addChild(ref));
			}
			
		}
		
	}
}